var proglangs =
[
	{
		"name" : "ActionScript",
		"link" : "http://en.wikipedia.org/wiki/ActionScript",
		"year" : 1998
	},
	{
		"name" : "AppleScript",
		"link" : "http://en.wikipedia.org/wiki/AppleScript",
		"year" : 1993
	},
	{
		"name" : "ASP",
		"link" : "http://en.wikipedia.org/wiki/Active_Server_Pages",
		"year" : 1996
	},
	{
		"name" : "BASIC",
		"link" : "http://en.wikipedia.org/wiki/BASIC",
		"year" : 1964
	},
	{
		"name" : "C",
		"link" : "http://en.wikipedia.org/wiki/C_(programming_language)",
		"year" : 1972
	},
	{
		"name" : "C++",
		"link" : "http://en.wikipedia.org/wiki/C%2B%2B",
		"year" : 1983
	},
	{
		"name" : "Clojure",
		"link" : "http://en.wikipedia.org/wiki/Clojure",
		"year" : 2007
	},
	{	
		"name" : "COBOL",
		"link" : "http://en.wikipedia.org/wiki/COBOL",
		"year" : 1959
	},
	{
		"name" : "ColdFusion",
		"link" : "http://en.wikipedia.org/wiki/ColdFusion",
		"year" : 1995
	},
	{
		"name" : "Erlang",
		"link" : "http://en.wikipedia.org/wiki/Erlang_(programming_language)",
		"year" : 1986
	},
	{
		"name" : "Fortran",
		"link" : "http://en.wikipedia.org/wiki/Fortran",
		"year" : 1957
	},
	{
		"name" : "Groovy",
		"link" : "http://en.wikipedia.org/wiki/Groovy_(programming_language)",
		"year" : 2003
	},
	{
		"name" : "Haskell",
		"link" : "http://en.wikipedia.org/wiki/Haskell_(programming_language)",
		"year" : 1990
	},
	{
		"name" : "Java",
		"link" : "http://en.wikipedia.org/wiki/Java_(programming_language)",
		"year" : 1995
	},
	{
		"name" : "JavaScript",
		"link" : "http://en.wikipedia.org/wiki/JavaScript",
		"year" : 1995
	},
	{
		"name" : "Lisp",
		"link" : "http://en.wikipedia.org/wiki/Lisp_(programming_language)",
		"year" : 1958
	},
	{
		"name" : "Perl",
		"link" : "http://en.wikipedia.org/wiki/Perl",
		"year" : 1987
	},
	{
		"name" : "PHP",
		"link" : "http://en.wikipedia.org/wiki/PHP",
		"year" : 1995
	},
	{
		"name" : "Python",
		"link" : "http://en.wikipedia.org/wiki/Python_(programming_language)",
		"year" : 1991
	},
	{
		"name" : "Ruby",
		"link" : "http://en.wikipedia.org/wiki/Ruby_(programming_language)",
		"year" : 1995
	},
	{
		"name" : "Scala",
		"link" : "http://en.wikipedia.org/wiki/Scala_(programming_language)",
		"year" : 2003
	},
	{
		"name" : "Scheme",
		"link" : "http://en.wikipedia.org/wiki/Scheme_(programming_language)",
		"year" : 1975
	}
];


var list = document.getElementById("proglangs_ul");
var sel = document.getElementById("proglangs_sel");

var step = 240 / (proglangs.length - 1);

for (var i = 0; i != proglangs.length; i++)
{
	/*var child = document.createElement("li");
	child.innerHTML = proglangs[i].name;
	child.setAttribute("style", "color: hsl(" + i * step + ", 100%, 50%)");
	list.appendChild(child);*/

	child = document.createElement("option");
	child.innerHTML = proglangs[i].name;
	child.setAttribute("value", i);
	sel.appendChild(child);
}

function changeActive(langid)
{
	document.getElementById("proglangs_active").innerHTML = "Du har valgt programmeringsspråket <a href=\"" + proglangs[langid].link + "\">" + proglangs[langid].name + "</a>";
}

function notImplemented()
{
	alert('Howdy cowboy! This functionality is not yet ready!');
}

document.getElementById("proglangs_sel").selectedIndex = -1;

//changeActive(0);